package com.hutao.medical.pojo.model;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hutao.medical.common.util.StringUtil;

/**
 * 长期医嘱记录
 * @author lyh
 *
 */
public class HospitalVisitDoctorAdviceStandingRecord {

	/**
	 * 患者
	 */
	private String patientName;
	
	/**
	 * 科室名称
	 */
	private String deptName;
	
	/**
	 * 床号名称
	 */
	private String bedName;
	
	/**
	 * ID号
	 */
	private String patientId;
	
	/**
	 * 病案号
	 */
	private String mrId;
	
	/**
	 * 长期医嘱项集合
	 */
	private List<HospitalVisitDoctorAdviceStandingItem> doctorAdviceStandingItems = new ArrayList<HospitalVisitDoctorAdviceStandingItem>();

	
	@JsonIgnore
	public void clearEmpty(){
		for (int i = this.doctorAdviceStandingItems.size()-1; i >=0; i--) {
			HospitalVisitDoctorAdviceStandingItem doctorAdviceStandingItem = this.doctorAdviceStandingItems.get(i);
			if(doctorAdviceStandingItem.isEmpty()){
				this.doctorAdviceStandingItems.remove(i);
			}
		}
	}
	
	public String getPatientName() {
		return StringUtil.meaningStr(patientName);
	}

	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}

	public String getDeptName() {
		return StringUtil.meaningStr(deptName);
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getBedName() {
		return StringUtil.meaningStr(bedName);
	}

	public void setBedName(String bedName) {
		this.bedName = bedName;
	}

	public String getPatientId() {
		return StringUtil.meaningStr(patientId);
	}

	public void setPatientId(String patientId) {
		this.patientId = patientId;
	}

	public String getMrId() {
		return StringUtil.meaningStr(mrId);
	}

	public void setMrId(String mrId) {
		this.mrId = mrId;
	}

	public List<HospitalVisitDoctorAdviceStandingItem> getDoctorAdviceStandingItems() {
		return doctorAdviceStandingItems;
	}

	public void setDoctorAdviceStandingItems(
			List<HospitalVisitDoctorAdviceStandingItem> doctorAdviceStandingItems) {
		this.doctorAdviceStandingItems = doctorAdviceStandingItems;
	}

	
	@JsonIgnore
    public boolean isEmpty(){
    	if(this.getMrId() == null && this.getPatientName() == null
    			&&this.getDeptName() == null && this.getBedName() == null
    			&&this.getPatientId() == null && this.getDoctorAdviceStandingItems().size() ==0){
    		return true;
    	}
    	return false;
    }

	
	
	
}
